$(document).ready(function() {
	$("#cityChoice").val('')
})
var weather = {
	晴: [-50, -30],
	夜: [-170, -30],
	阴: [-300, -30],
	多云: [-460, -30],
	雨: [-50, -180],
	雷: [-190, -180],
	雷阵雨: [-340, -180],
	雪: [-500, -180],
	霾: [-50, -310],
}
var cityPicker = new HzwCityPicker({
	data: data,
	target: 'cityChoice',
	valType: 'k-v',
	hideCityInput: {
		name: 'city',
		id: 'city'
	},
	hideProvinceInput: {
		name: 'province',
		id: 'province'
	},
	callback: function() {
		show($('#cityChoice').val())
	}
});
cityPicker.init();

function show(city) {
	var data = {
		location: city,
		output: 'json',
		ak: 'QSvktjUUa3PE5lIASNlNae6uqzMbK5oG'
	}
	$.getJSON('http://api.map.baidu.com/telematics/v3/weather?callback=?', data, function(data) {
		console.log(data)
		console.log(data.results[0].weather_data[0].date)
		$('img').hide()
		var html = template('weather-box', data)
		$('.wheater-info').html(html)
	})
}